<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      function checkSpam(str) {
        // str 全部转换为小写  // viAgra  xXx
        const s1 = str.toLowerCase(); //buy viagra now
        if (s1.includes("xxx") || s1.includes("viagra ")) {
          return true;
        }
        return false;
      }
      console.log(checkSpam("buy ViAgRA now"));
      console.log(checkSpam("free xxxxx"));
      console.log(checkSpam("innocent rabbit"));
    </script>
  </body>
</html>
